<!DOCTYPE html>
<html lang="en" data-th-fragment="header">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    
    <!-- Tether core CSS -->
    <link href="../../css/tether.min.css" th:href="@{/css/tether.min.css}" rel="stylesheet">
    
	<!-- Bootstrap core CSS -->
    <link href="../../css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    
    <!-- Font-Awesome CSS -->
    <link href="../../css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet">
    
    <!-- Custom styles -->
    <link href="../../css/blog.css" th:href="@{/css/blog.css}" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse bg-inverse navbar-toggleable-md">
    <div class="container">
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
                data-target="#navbarsContainer" aria-controls="navbarsExampleContainer" aria-expanded="false"
                aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <a class="navbar-brand" href="/" th:href="@{/}">Spring Security Tutorial</a>

        <div class="collapse navbar-collapse" id="navbarsContainer">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="/" th:href="@{/}">首页 <span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/users" th:href="@{/users}">用户管理</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/admins" th:href="@{/admins}">管理员管理</a>
                </li>
            </ul>

	 		<ul class="navbar-nav mr-auto navbar-right">
	          <li class="nav-item" sec:authorize="isAnonymous()">
				<a class="nav-link" href="/login" th:href="@{/login}">登录 </a>
	          </li>
	           <li class="nav-item" sec:authorize="isAuthenticated()">
					<span class="nav-link"  sec:authentication="name"></span>
	          </li>
	          <li class="nav-item">
		        <form action="/logout" th:action="@{/logout}" method="post">
					<input class="btn btn-default" type="submit" value="退出"/>
				</form>
	          </li>
	        </ul>
        </div>
    </div>
</nav>
</body>
</html>